using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._MosaicDataset
{
    /// <summary>
    /// <para>Build Footprints</para>
    /// <para>Computes the extent of every raster in a mosaic dataset. This tool is used when you have added or removed raster datasets from a mosaic dataset and want to recompute the footprints.</para>
    /// <para>计算镶嵌数据集中每个栅格的范围。当您在镶嵌数据集中添加或移除栅格数据集并希望重新计算轮廓线时，将使用此工具。</para>
    /// </summary>    
    [DisplayName("Build Footprints")]
    public class BuildFootprints : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public BuildFootprints()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_mosaic_dataset">
        /// <para>Mosaic Dataset</para>
        /// <para>The mosaic dataset that contains the raster datasets whose footprints you want to compute.</para>
        /// <para>包含要计算其封装的栅格数据集的镶嵌数据集。</para>
        /// </param>
        public BuildFootprints(object _in_mosaic_dataset)
        {
            this._in_mosaic_dataset = _in_mosaic_dataset;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Build Footprints";

        public override string CallName => "management.BuildFootprints";

        public override List<string> AcceptEnvironments => ["parallelProcessingFactor"];

        public override object[] ParameterInfo => [_in_mosaic_dataset, _where_clause, _reset_footprint, _min_data_value, _max_data_value, _approx_num_vertices, _shrink_distance, _maintain_edges.GetGPValue(), _skip_derived_images.GetGPValue(), _update_boundary.GetGPValue(), _request_size, _min_region_size, _simplification_method.GetGPValue(), _edge_tolerance, _max_sliver_size, _min_thinness_ratio, _out_mosaic_dataset];

        /// <summary>
        /// <para>Mosaic Dataset</para>
        /// <para>The mosaic dataset that contains the raster datasets whose footprints you want to compute.</para>
        /// <para>包含要计算其封装的栅格数据集的镶嵌数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Mosaic Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_mosaic_dataset { get; set; }


        /// <summary>
        /// <para>Query Definition</para>
        /// <para>An SQL expression to select specific raster datasets within the mosaic dataset.</para>
        /// <para>用于在镶嵌数据集中选择特定栅格数据集的 SQL 表达式。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Query Definition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _where_clause { get; set; } = null;


        /// <summary>
        /// <para>Computation Method</para>
        /// <para><xdoc>
        ///   <para>Refine the footprints using one of the following methods:</para>
        ///   <bulletList>
        ///     <bullet_item>Radiometry— Exclude pixels with a value outside of a defined range. This option is generally used to exclude border areas, which do not contain valid data. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geometry— Restore the footprint to its original geometry.</bullet_item><para/>
        ///     <bullet_item>Copy to sibling— Replace the panchromatic footprint with the multispectral footprint when using a pan-sharpened raster type. This can occur when the panchromatic and multispectral images do not have identical geometries.</bullet_item><para/>
        ///     <bullet_item>None—Do not redefine the footprints.</bullet_item><para/>
        ///   </bulletList>
        ///   <para></para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>使用以下方法之一细化封装：</para>
        ///   <bulletList>
        ///     <bullet_item>辐射测量 - 排除值超出定义范围的像素。此选项通常用于排除不包含有效数据的边界区域。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>几何 （Geometry） - 将封装恢复到其原始几何。</bullet_item><para/>
        ///     <bullet_item>复制到同级 - 使用平移锐化栅格类型时，将全色轮廓线替换为多光谱轮廓线。当全色图像和多光谱图像的几何形状不同时，可能会发生这种情况。</bullet_item><para/>
        ///     <bullet_item>无 （None） - 不重定义封装。</bullet_item><para/>
        ///   </bulletList>
        ///   <para></para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Computation Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _reset_footprint { get; set; } = null;


        /// <summary>
        /// <para>Minimum Data Value</para>
        /// <para>Exclude pixels with a value less than this number.</para>
        /// <para>排除值小于此数字的像素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Data Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _min_data_value { get; set; } = 1;


        /// <summary>
        /// <para>Maximum Data Value</para>
        /// <para>Exclude pixels with a value greater than this number.</para>
        /// <para>排除值大于此数字的像素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Data Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _max_data_value { get; set; } = 254;


        /// <summary>
        /// <para>Approximate number of vertices</para>
        /// <para>Choose between 4 and 10,000. More vertices will improve accuracy but can extend processing time. A value of -1 will calculate all vertices. More vertices will increase accuracy but also the processing time.</para>
        /// <para>在 4 到 10,000 之间进行选择。更多的顶点将提高精度，但可以延长处理时间。值 -1 将计算所有顶点。更多的顶点将提高精度，但也会缩短处理时间。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Approximate number of vertices")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _approx_num_vertices { get; set; } = 80;


        /// <summary>
        /// <para>Shrink distance</para>
        /// <para><xdoc>
        ///   <para>Clip the footprint by this distance. This can eliminate artifacts from using lossy compression, which causes the edges of the image to overlap into NoData areas.</para>
        ///   <para>Shrinking of the polygon is used to counteract effects of lossy compression, which causes edges of the image to overlap into NoData areas.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将封装剪断此距离。这可以消除使用有损压缩产生的伪影，这会导致图像的边缘重叠到 NoData 区域。</para>
        ///   <para>多边形的收缩用于抵消有损压缩的影响，这会导致图像的边缘重叠到 NoData 区域中。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Shrink distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _shrink_distance { get; set; } = 0;


        /// <summary>
        /// <para>Maintain sheet edges</para>
        /// <para><xdoc>
        ///   <para>Alter the footprints of raster datasets that have been tiled and are adjacent (line up along the seams with little to no overlap).</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Remove the sheet edges from all the footprints. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Maintain the footprints in their original state.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>更改已切片且相邻的栅格数据集的轮廓线（沿接缝排列，几乎没有重叠）。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 （Unchecked） - 从所有封装中移除图纸边缘。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 （Checked） - 将封装保持在其原始状态。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maintain sheet edges")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _maintain_edges_value _maintain_edges { get; set; } = _maintain_edges_value._false;

        public enum _maintain_edges_value
        {
            /// <summary>
            /// <para>MAINTAIN_EDGES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MAINTAIN_EDGES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_MAINTAIN_EDGES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_MAINTAIN_EDGES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Skip overviews</para>
        /// <para><xdoc>
        ///   <para>Adjust the footprints of overviews.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Do not adjust the footprints of overviews. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Adjust the footprints of overviews and associated raster datasets.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>调整概视图的封装。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 不调整概视图的轮廓线。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 调整概视图和相关栅格数据集的轮廓线。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Skip overviews")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _skip_derived_images_value _skip_derived_images { get; set; } = _skip_derived_images_value._true;

        public enum _skip_derived_images_value
        {
            /// <summary>
            /// <para>SKIP_DERIVED_IMAGES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SKIP_DERIVED_IMAGES")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SKIP_DERIVED_IMAGES</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SKIP_DERIVED_IMAGES")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Update Boundary</para>
        /// <para><xdoc>
        ///   <para>Update the boundary of the mosaic dataset if you have added or removed imagery that changes the extent.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Update the boundary. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Do not update the boundary.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果已添加或移除更改范围的影像，则更新镶嵌数据集的边界。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 更新边界。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 （Unchecked） - 不更新边界。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Update Boundary")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _update_boundary_value _update_boundary { get; set; } = _update_boundary_value._true;

        public enum _update_boundary_value
        {
            /// <summary>
            /// <para>UPDATE_BOUNDARY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("UPDATE_BOUNDARY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_BOUNDARY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_BOUNDARY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Request Size</para>
        /// <para>Set the resampled extent (in columns and rows) for the raster when building footprints. Greater image resolution provides more detail in the raster dataset but increases the processing time. A value of -1 will compute the footprint at the original resolution.</para>
        /// <para>在构建覆盖区时，设置栅格的重采样范围（以列和行为单位）。更高的图像分辨率可在栅格数据集中提供更多详细信息，但会增加处理时间。值 -1 将计算原始分辨率下的占用空间。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Request Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _request_size { get; set; } = 2000;


        /// <summary>
        /// <para>Minimum Region Size</para>
        /// <para>Avoid small holes in your imagery when using pixel values to create a mask. For example, your imagery may have a range of values from 0 to 255, and to mask clouds, you've excluded values from 245 to 255, which may cause other, noncloud pixels to be masked as well. If those areas are smaller than the number of pixels specified here, they will not be masked out.</para>
        /// <para>使用像素值创建蒙版时，请避免影像中出现小孔洞。例如，影像的值范围可能介于 0 到 255 之间，为了遮罩云，您排除了 245 到 255 之间的值，这可能会导致其他非云像素也被遮罩。如果这些区域小于此处指定的像素数，则不会屏蔽它们。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Region Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _min_region_size { get; set; } = 100;


        /// <summary>
        /// <para>Simplification Method</para>
        /// <para><xdoc>
        ///   <para>Reduce the number of vertices in the footprint to improve performance.</para>
        ///   <bulletList>
        ///     <bullet_item>None—Do not limit the number of vertices. This is the default.</bullet_item><para/>
        ///     <bullet_item>Convex hull—Use the minimum bounding box to simplify the footprint.</bullet_item><para/>
        ///     <bullet_item>Envelope—Use the envelope of each mosaic dataset item to simplify the footprint.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>减少封装中的顶点数以提高性能。</para>
        ///   <bulletList>
        ///     <bullet_item>无 （None） - 不限制折点数。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>凸包 （Convex hull） - 使用最小边界框来简化封装。</bullet_item><para/>
        ///     <bullet_item>包络 - 使用每个镶嵌数据集项目的信封来简化封装。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplification Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _simplification_method_value _simplification_method { get; set; } = _simplification_method_value._NONE;

        public enum _simplification_method_value
        {
            /// <summary>
            /// <para>None</para>
            /// <para>None—Do not limit the number of vertices. This is the default.</para>
            /// <para>无 （None） - 不限制折点数。这是默认设置。</para>
            /// </summary>
            [Description("None")]
            [GPEnumValue("NONE")]
            _NONE,

            /// <summary>
            /// <para>Convex hull</para>
            /// <para>Convex hull—Use the minimum bounding box to simplify the footprint.</para>
            /// <para>凸包 （Convex hull） - 使用最小边界框来简化封装。</para>
            /// </summary>
            [Description("Convex hull")]
            [GPEnumValue("CONVEX_HULL")]
            _CONVEX_HULL,

            /// <summary>
            /// <para>Envelope</para>
            /// <para>Envelope—Use the envelope of each mosaic dataset item to simplify the footprint.</para>
            /// <para>包络 - 使用每个镶嵌数据集项目的信封来简化封装。</para>
            /// </summary>
            [Description("Envelope")]
            [GPEnumValue("ENVELOPE")]
            _ENVELOPE,

        }

        /// <summary>
        /// <para>Edge tolerance</para>
        /// <para><xdoc>
        ///   <para>Snap the footprint to the sheet edge if it is within this tolerance. Units are the same as those in the mosaic dataset coordinate system.</para>
        ///   <para>By default, the value is empty for which the tolerance is computed based on the pixel size corresponding to the requested resampled raster.</para>
        ///   <para>A value of -1 will compute the tolerance using the average pixel size of the mosaic dataset.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>如果尺寸在此公差范围内，则将封装捕捉到板材边缘。单位与镶嵌数据集坐标系中的单位相同。</para>
        ///   <para>默认情况下，该值为空，容差根据与请求的重采样栅格相对应的像素大小计算。</para>
        ///   <para>值 -1 将使用镶嵌数据集的平均像素大小计算容差。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Edge tolerance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _edge_tolerance { get; set; } = null;


        /// <summary>
        /// <para>Maximum Sliver Size</para>
        /// <para><xdoc>
        ///   <para>Identify all polygons that are smaller than the square of this value. The value is specified in pixels and is based on the Request Size, not the spatial resolution of the source raster.</para>
        ///   <para>Regions less than the (Maximum Sliver Size)^2 and less than the Minimum Thinness Ratio are considered slivers and will be removed.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>识别小于此值的平方的所有多边形。该值以像素为单位指定，并且基于请求大小，而不是源栅格的空间分辨率。</para>
        ///   <para>小于（最大薄片尺寸）^2 且小于最小薄度比的区域被视为薄片，将被移除。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Sliver Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _max_sliver_size { get; set; } = 20;


        /// <summary>
        /// <para>Minimum Thinness Ratio</para>
        /// <para><xdoc>
        ///   <para>Define the thinness of slivers on a scale from 0 to 1.0, where 1.0 represents a circle and 0.0 represents a polygon that approaches a straight line.</para>
        ///   <para>Polygons that are below both the Maximum Sliver Size and Minimum Thinness Ratio will be removed from the footprint.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>在 0 到 1.0 的刻度上定义条子的细度，其中 1.0 表示圆形，0.0 表示接近直线的多边形。</para>
        ///   <para>同时低于“最大薄片尺寸”和“最小薄度比”的多边形将从封装中移除。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Thinness Ratio")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _min_thinness_ratio { get; set; } = 0.05;


        /// <summary>
        /// <para>Updated Mosaic Dataset</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Mosaic Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_mosaic_dataset { get; set; }


        public BuildFootprints SetEnv(object parallelProcessingFactor = null)
        {
            base.SetEnv(parallelProcessingFactor: parallelProcessingFactor);
            return this;
        }

    }

}